package com.dream.xiaobo.dao;


import com.dream.xiaobo.entity.Item;
import com.dream.xiaobo.entity.Orders;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

/**
 * @author xiaobo
 * @date 2021/9/2 - 15:09
 */
public interface OrdersDao {

    /**
     * 插入订单
     * @param orders
     * @throws SQLException
     */
    void insertOrder(Orders orders) throws SQLException;

    /**
     * 插入订单项
     * @param item
     * @throws SQLException
     */
    void insertItem(List<Item> item) throws SQLException;

    /**
     * 根据用户Id查询订单信息
     * @param uId
     * @return
     * @throws SQLException
     * @throws InvocationTargetException
     * @throws IllegalAccessException
     */
    List<Orders> selectOrderByUId(Integer uId) throws SQLException, InvocationTargetException, IllegalAccessException;

    /**
     * 根据订单Id查询用户信息
     * @param oId
     * @return
     * @throws SQLException
     * @throws InvocationTargetException
     * @throws IllegalAccessException
     */
    Orders selectOrderByOId(String oId) throws SQLException, InvocationTargetException, IllegalAccessException;

    /**
     * 根据订单Id查询订单项
     * @param oId
     * @return
     * @throws SQLException
     * @throws InvocationTargetException
     * @throws IllegalAccessException
     */
    List<Item> selectItemByOId(String oId) throws SQLException, InvocationTargetException, IllegalAccessException;

    /**
     * 更新订单Id更新订单
     * @param oId
     * @throws SQLException
     */
    void updateOrderByOId(String oId) throws SQLException;

    /**
     * 查询订单全部信息
     * @return
     * @throws SQLException
     * @throws InvocationTargetException
     * @throws IllegalAccessException
     */
    List<Orders> selectOrder() throws SQLException, InvocationTargetException, IllegalAccessException;

    /**
     * 根据订单Id更新
     * @param oId
     * @throws SQLException
     */
    void updateOrderByOidHair(String oId) throws SQLException;

    /**
     * 根据订单Id更新
     * @param oId
     * @throws SQLException
     */
    void updateOrderByOIdCollect(String oId) throws SQLException;
}
